<!doctype html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<title>教师界面|密码修改</title>
		<meta name="keywords" content="六个核桃" />
		<meta name="description" content="六个核桃" />
		<link href="css/layout.css" rel="stylesheet" type="text/css">
		<link href="css/login.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="js/js.js"></script>
		<style>
			.gt_ajax_tip .ready{right: -56px;}
		</style>
	</head>
		<script type="text/javascript">
				var str=location.href;
				var numNode=str.indexOf("?");
				var str1=str.substr(numNode+1);
				var username=str1.split("=")[1];
				//window.alert(username);
				//var text=document.getElementById("teaname");
				function getXmlHttpObject(){
				var xmlHttpRequest;
				if(window.ActiveXObject){
					}else{
						xmlHttpRequest=new XMLHttpRequest();
					}
					return xmlHttpRequest;
				}
				function changePsw(){
					myXmlHttpRequest=getXmlHttpObject();
						if(myXmlHttpRequest){
							var oldpsw=document.getElementById("oldpsw").value;
							var newpsw=document.getElementById("newpsw").value;
							var url="http://localhost:8080/StuScoreSystem/Login?method=changePsw&username="+username+"&oldpsw="+oldpsw+"&newpsw="+newpsw+"&post=teacher";
							myXmlHttpRequest.open("get",url,true);
							myXmlHttpRequest.onreadystatechange=progress;
							myXmlHttpRequest.send(null);
						}
						else{
							window.alert("error");
						}
				}
				function progress(){
					if(myXmlHttpRequest.readyState==4){
						var json=myXmlHttpRequest.responseText;
						var json_obj=eval("("+json+")");
						//var json1=JSON.parse(json);
						var state_obj=json_obj.meta;
						window.alert(state_obj.message);
						if(state_obj.state=="success")
							window.location.href="teacher_info.html?username="+username+""
						else
							location.reload(true); 
						//window.close();
					}
				}
	    </script>	
<script>
 document.getElementById('link1').href="teacher_info.html"+"?"+"username="+username;
 document.getElementById('link2').href="teacher_repassword.html"+"?"+"username="+username;
 document.getElementById('link3').href="teacher_query_info.html"+"?"+"username="+username;
 document.getElementById('link4').href="teacher_score_input.html"+"?"+"username="+username;
 document.getElementById('link5').href="teacher_query_score.html"+"?"+"username="+username;
 document.getElementById('link6').href="teacher_score_anlysis.html"+"?"+"username="+username;
 document.getElementById('link7').href="teacher_score_feedback.html"+"?"+"username="+username;
 </script>

<body class="login-bg">
	<div class="main ">
		<!--登录-->
		<div class="login-dom login-max">
			<div class="logo text-center">
				<a href="#">
				<img src="Images/logo.png" width="180px" height="180px">
				</a>
			</div>
			<div class="login container " id="login">
				<p class="text-big text-center logo-color">
					教师密码修改
				</p>
				<p class=" text-center margin-small-top logo-color text-small">
					
				</p>
				<form class="register-form" action="index.html" method="post" autocomplete="off">
					<div class="num-box ">
						<div class="area fl">
							原密码
						</div>
						<input type="text" placeholder="请输入原密码" autofocus="true" id="oldpsw" name="mobile" datatype="m" >
					</div>
					<div class="num-box ">
						<div class="area fl">
							新密码
						</div>
						<input type="text" placeholder="请输入新密码" autofocus="true" id="newpsw" name="mobile" datatype="m" >
					</div>
					<div class="slider-box">
						<div id="captcha" style="margin-left: 12px;">
						</div>
					</div>
					<input type="hidden" name="formhash" value="5abb5d21"/>
					<input type="button" onclick="changePsw()" class="btn text-center login-btn" value="确认密码">
					<div class="forget">
						<a href="repassword.html" class="forget-pwd text-small fl"></a><a href="login.html" class="forget-new text-small fr" id="forger-login"></a>
					</div>
				</form>
			</div>
		</div>
		<div class="footer text-center text-small ie">
			Copyright六个核桃小组所有 
			
			<span class="margin-left margin-right"></span>
			<script src="#" language="JavaScript"></script>
		</div>
		<div class="popupDom">
			<div class="popup text-default">
			</div>
		</div>
	</div>
</body>
<script type="text/javascript" src="Js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript">
	
	
</script>
</html>